package com.derek.omshopping.utils;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
 * Created by My on 2016/9/12.
 */
public class Okhttputils {
        private Okhttputils() {
        }

        private static Okhttputils OK = new Okhttputils();

        //静态工厂方法
        public static Okhttputils getInstance() {
            return OK;
        }

        OkHttpClient client = new OkHttpClient();

        public Call run(String url) throws IOException {
            Request request = new Request.Builder()
                    .url(url)
                    .build();
            Call call=client.newCall(request);
//        Response response = client.newCall(request).execute();
            return call;
        }
    }


